Skip to content

Nose tool#14

Open
SageCode98 wants to merge 10 commits intoVDBWRAIR:masterfrom
SageCode98:nose_tool
Open

Nose tool#14
SageCode98 wants to merge 10 commits intoVDBWRAIR:masterfrom
SageCode98:nose_tool

Conversation

@SageCode98
Copy link
Copy Markdown

nose_tool test code for primer matching (beta)

@SageCode98
Copy link
Copy Markdown
Author

@averagehat
Copy link
Copy Markdown
Collaborator

Comment thread test/draft_test_primer_annotate.py
Comment thread test/draft_test_primer_annotate.py
Comment thread test/draft_test_primer_annotate.py Outdated
Comment thread test/draft_test_primer_annotate.py Outdated
SageCode98 and others added 5 commits October 25, 2019 10:30
#Having difficulty instantiating attributes for match_primer for actual and expected
actual = match_primers( primer= [MappingCoordinate(10, 40)], alts= [Alt(24, 'G')], bamReads=[BamRead( 234, 5, 9, 154, 'ACGACGGCGCACACGGCAGCAGCAGCGACGCGGGGTTTATATATGGCACGAGCGCGCAGCGACGCAGCGCGCTTGAGACGAGGGTAGAGAGTGCGACGCCGCGCAGGAGAGGGGAGAGG')
expected = match_primers( primer= [MappingCoordinate(10, 40)], alts= [Alt(24, 'G')], bamReads=[BamRead( 234, 5, 9, 154, 'ACGACGGCGCACACGGCAGCAGCAGCGACGCGGGGTTTATATATGGCACGAGCGCGCAGCGACGCAGCGCGCTTGAGACGAGGGTAGAGAGTGCGACGCCGCGCAGGAGAGGGGAGAGG')
eq_(3, 5, "Actual {0} is not Expected {1}".format(actual, expected))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to compare the actual and expected here

other: List[Tuple[str, int]] # e.g. N, insertion, etc


def match_primers(primers: List[MappingCoordinate], alts: List[Alt], bamReads: Iterator[BamRead]) -> List[PrimerCount]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to delete this function or give it an empty body, i.e.

def foo():
    pass



#def test_primer_annotate(Alt: [str, int], consensus: , MappingCoordinate:[int, int], BamRead[int, int, int, int, str,str] PrimerCount) -> None:
def match_primers(primers= [MappingCoordinate(int,int)], alts= [Alt(int,str], bamReads=[BamRead(int, int,int, int, str)] -> PrimerCount: List[PrimerCount(int,int,int,int,int,int,int,int)]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function should be called test_match_primers and accept no arguments

ok_(True, "True is true")
#Having difficulty instantiating attributes for match_primer for actual and expected
actual = match_primers( primer= [MappingCoordinate(10, 40)], alts= [Alt(24, 'G')], bamReads=[BamRead( 234, 5, 9, 154, 'ACGACGGCGCACACGGCAGCAGCAGCGACGCGGGGTTTATATATGGCACGAGCGCGCAGCGACGCAGCGCGCTTGAGACGAGGGTAGAGAGTGCGACGCCGCGCAGGAGAGGGGAGAGG')
expected = match_primers( primer= [MappingCoordinate(10, 40)], alts= [Alt(24, 'G')], bamReads=[BamRead( 234, 5, 9, 154, 'ACGACGGCGCACACGGCAGCAGCAGCGACGCGGGGTTTATATATGGCACGAGCGCGCAGCGACGCAGCGCGCTTGAGACGAGGGTAGAGAGTGCGACGCCGCGCAGGAGAGGGGAGAGG')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected and actual seem to be the same. actual should be the result of a call to the function we are testing. expected should be defined separately, in this case, it would be a PrimerCount object. See https://realpython.com/python-testing/#how-to-structure-a-simple-test

Copy link
Copy Markdown
Author

@SageCode98 SageCode98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread test/draft_test_primer_annotate.py
querySequence='ACGACGGCGCACACGGCAGCAGCAGCGACGCGGGGTTTATATATGGCACGAGCGCGCAGCGACGCAGCGCGCTTGAGACGAGGGTAGAGAGTGCGACGCCGCGCAGGAGAGGGGAGAGG') ]
result = match_primers(primers=coordinates, alts=alts, bamReads=mapperReadsOverlappingPosition, thresh=20)
expected = PrimerCount(24, 'G', altTotal=1, alt_Primers_overlap=1, altPrimersWithinEnd=1, primer_base='A')
# TODO FIX SO IT FAILS again
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to check that the result fits the expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants